package com.gzx.plugin.data.wckj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gzx.plugin.data.wckj.entity.JudgeUserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WckjJudgeUserInfoDao extends BaseMapper<JudgeUserInfo> {
    @Insert({
            "<script>",
            "INSERT INTO data_wckj_userinfo",
            "(ywyh_id, case_id, product_name, name, gender, mobile, id_no_area, id_no, address,",
            "now_address, account_balance, birth, special_name, special_mobileno, special_relation,",
            "special_name2, special_mobileno2, special_relation2, last_login_time, create_time, update_time)",
            "VALUES ",
            "<foreach collection='list' item='user' separator=','>",
            "(",
            "#{user.ywyhId}, ",
            "#{user.caseId}, ",
            "#{user.productName}, ",
            "#{user.name}, ",
            "#{user.gender}, ",
            "#{user.mobileList}, ",
            "#{user.idNoArea}, ",
            "#{user.idNo}, ",
            "#{user.address}, ",
            "#{user.nowAddress}, ",
            "#{user.accountBalance}, ",
            "#{user.birth}, ",
            "#{user.specialName}, ",
            "#{user.specialMobileNo}, ",
            "#{user.specialRelation}, ",
            "#{user.specialName2}, ",
            "#{user.specialMobileNo2}, ",
            "#{user.specialRelation2}, ",
            "#{user.lastLoginTime}, ",
            "NOW(), ",     // create_time
            "NOW()",       // update_time
            ")",
            "</foreach>",
            "</script>"
    })
    void batchSave(@Param("list") List<JudgeUserInfo> list);
}
